package com.veepeak.server.common;


import javax.persistence.MappedSuperclass;
import java.util.Objects;

/**
 * Created by mabin on 16/6/15.
 */
@MappedSuperclass
public abstract class BaseDTO implements java.io.Serializable {

    private String id;
    private Integer version;
    private String remark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BaseDTO baseDTO = (BaseDTO) o;
        return Objects.equals(id, baseDTO.id) &&
                Objects.equals(version, baseDTO.version) &&
                Objects.equals(remark, baseDTO.remark);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, version, remark);
    }

    @Override
    public String toString() {
        return "BaseDTO{" +
                "id='" + id + '\'' +
                ", version=" + version +
                ", remark='" + remark + '\'' +
                '}';
    }
}
